import { App } from "vue";
import MainContent from './MainContent.vue'
import SearchBar from './SearchBar.vue'
import MenuTree from './menu/menu.vue'
import LayoutTable from './table/LayoutTable.vue'
import {ElMessage, ElMessageBox} from "element-plus";

const components = [
    MainContent,
    SearchBar,
    MenuTree,
    LayoutTable,
]

export const commonLayout = {
    install(app: App) {
        components.map(item => app.component(item.name, item))
    }
}

export const globalMessage = {
    install(app: App) {
        app.config.globalProperties.$message = ElMessage
    }
}

export const globalMessageBox = {
    install(app: App) {
        app.config.globalProperties.$msgbox = ElMessageBox
        app.config.globalProperties.$alert = ElMessageBox.alert
        app.config.globalProperties.$confirm = ElMessageBox.confirm
        app.config.globalProperties.$prompt = ElMessageBox.prompt
    }
}

